<template>
  <div>
    <el-table
        :data="tableData"
        stripe
        style="width: 100%">
      <el-table-column
          type="index"
          label="序号"
          width="60">
      </el-table-column>
      <el-table-column
          prop="username"
          label="姓名"
          width="180">
      </el-table-column>
      <el-table-column
          prop="role"
          label="职位">
      </el-table-column>
      <el-table-column
          prop="gender"
          label="性别">
      </el-table-column>
      <el-table-column
          label="绩效">
        <template slot-scope="scope">
          <el-form>
          <el-form-item>
            <el-input v-model="scope.row.input"></el-input>
          </el-form-item>
          </el-form>
        </template>
      </el-table-column>
      <el-table-column
          label="操作">
        <el-button type="primary" plain>提交</el-button>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
export default {
  data() {
    return {
      tableData: [
        {
          gender: '2016-05-02',
          username: '王小虎',
          role: '上海市普陀区金沙江路 1518 弄'
        },
        ],
      input: ''
    }
  },
  methods:{
    listUser(){
      let url='http://localhost:9085/user/list'
      console.log(url)
      this.axios
          .create({'headers': {'Authorization': localStorage.getItem('jwt')}})
          .get(url).then(res=>{
        let responseBody=res.data;
        this.tableData=responseBody.data;
      })
    },
  },
  mounted() {
    this.listUser()
  }
}
</script>

<style scoped>

</style>
